﻿<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>EasyShare-小型资源论坛平台（首页）</title>
    <link rel="icon" href="/favicon.ico" th:href="@{/favicon.ico}" sizes="32x32">
    <link href="/css/main/bootstrap.min.css" th:href="@{/css/main/bootstrap.min.css}" rel="stylesheet">
    <link href="/css/main/index-style.css" th:href="@{/css/main/index-style.css}" rel="stylesheet">
    <link href="/css/main/index-nprogress.css" th:href="@{/css/main/index-nprogress.css}" rel="stylesheet">
    <link href="/css/main/sidebar-canvi.css" th:href="@{/css/main/sidebar-canvi.css}" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="/js/main/html5shiv.min.js" type="text/javascript" th:href="@{/js/main/html5shiv.min.js}"></script>
    <script src="/js/main/respond.min.js" type="text/javascript" th:href="@{/js/main/respond.min.js}"></script>
    <script src="/js/main/selectivizr-min.js" type="text/javascript" th:href="@{/js/main/selectivizr-min.js}"></script>
    <![endif]-->
    <meta name="Keywords" content=""/>
    <meta name="description" content=""/>
    <style type="text/css">
        .androidMainImg {
            width: auto;
            height: auto;
        }

        .windowsMainImg {
            width: 730px;
            height: 410px;
        }
    </style>
    <script type="text/javascript">
        //判断浏览器是否支持HTML5
        // window.onload = function () {
        //     if (!window.applicationCache) {
        //         window.location.href = "/ie";
        //     }
        // }
    </script>
</head>

<body>
<aside th:replace="~{commons/sidebar :: sidebar}"></aside>
<section class="container user-select">
    <header th:replace="~{commons/leftbar :: leftbar}"></header>
    <!--/超小屏幕可见-->
    <div class="content-wrap"><!--内容-->
        <div class="content">
            <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!--banner-->
                <ol class="carousel-indicators"
                    th:if="${session.levelThreeSize==3||session.levelThreeSize eq null}">
                    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
                </ol>
                <ol class="carousel-indicators" th:if="${session.levelThreeSize==2}">
                    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                </ol>
                <ol class="carousel-indicators" th:if="${session.levelThreeSize==1}">
                    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                </ol>
                <div class="carousel-inner" role="listbox"
                     th:if="${session.firstArticleOfLevelThree ne null && session.firstArticleOfLevelThree.getArticleid() ne null}">
                    <div class="item active"><a href="/article/show"
                                                th:href="'/article/show/'+${session.firstArticleOfLevelThree.getArticleid()}"
                                                target="_blank">
                        <img src="/img/main/img1.jpg" alt="ArticleImg"
                             th:src="${session.firstArticleOfLevelThree.getArticlecover()}" style="width: 100%;height: auto"/></a>
                        <div class="carousel-caption" th:text="${session.firstArticleOfLevelThree.getArticletitle()}"
                             style="padding-top: 20px">
                            Title here.
                        </div>
                        <span class="carousel-bg"></span>
                    </div>
                    <div class="item" th:each="notFirstArticleOfLevelThree:${session.notFirstArticleOfLevelThree}">
                        <!--此处报错并非存在异常，而在于后台代码编写以及idea解析问题-->
                        <a href="/article/show" th:href="'/article/show/'+${notFirstArticleOfLevelThree.getArticleid()}"
                           target="_blank"><img src="/img/main/img1.jpg"
                                                alt="ArticleImg"
                                                th:src="${notFirstArticleOfLevelThree.getArticlecover()}"
                                                style="width: 100%;height: auto"/></a>
                        <div class="carousel-caption" th:text="${notFirstArticleOfLevelThree.getArticletitle()}">
                            Title here.
                        </div>
                        <span class="carousel-bg"></span>
                    </div>
                </div>
                <div class="carousel-inner" role="listbox" th:if="${session.firstArticleOfLevelThree eq null}">
                    <div class="item active"><a href="content.html" target="_blank"><img src="/img/main/img1.jpg"
                                                                                         alt=""
                                                                                         style="width: 100%;height: 100%"/></a>
                        <div class="carousel-caption"> 欢迎来到EasyShare技术博客，在这里可以看到网站前端和后端的技术等</div>
                        <span class="carousel-bg"></span></div>
                    <div class="item"><a href="content.html" target="_blank"><img src="/img/main/img2.jpg" alt=""
                                                                                  style="width: 100%;height: 100%"/></a>
                        <div class="carousel-caption"> 欢迎来到EasyShare技术博客，在这里可以看到网站前端和后端的技术等</div>
                        <span class="carousel-bg"></span></div>
                    <div class="item"><a href="content.html" target="_blank"><img src="/img/main/img3.jpg" alt=""
                                                                                  style="width: 100%;height: 100%"/></a>
                        <div class="carousel-caption"> 欢迎来到EasyShare技术博客，在这里可以看到网站前端和后端的技术等</div>
                        <span class="carousel-bg"></span></div>
                </div>
                <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> <span
                        class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span class="sr-only">Previous</span>
                </a> <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">Next</span>
                </a></div>
            <!--/banner-->
            <div class="content-block hot-content hidden-xs"
                 th:if="${session.hotArticles ne null && session.hotArticles.size()>0}">
                <h2 class="title"><strong>本周热门排行</strong></h2>
                <ul>
                    <li class="large"><a href="content.html" target="_blank"
                                         th:href="'/article/show/'+${session.hotArticle1 ne null ? session.hotArticle1.getArticleid() : '-1'}"><img
                            src="/img/main/img3.jpg" alt="ArticleImg"
                            th:src="${session.hotArticle1 ne null ? session.hotArticle1.getArticlecover() : '/img/main/img3.jpg'}">
                        <h3 th:text="${session.hotArticle1 ne null ? session.hotArticle1.getArticletitle() : 'null'}">
                            欢迎来到EasyShare技术博客 </h3>
                    </a></li>
                    <!--此处报错并非存在异常，而在于后台代码编写以及idea解析问题-->
                    <li th:each="hotArticle:${session.hotArticles}"><a href="content.html" target="_blank"
                                                                       th:href="'/article/show/'+${hotArticle.getArticleid()}"><img
                            src="/img/main/logo.jpg" th:src="${hotArticle.getArticlecover()}" alt="">
                        <h3 th:text="${hotArticle.getArticletitle()}"> 欢迎来到EasyShare技术博客,在这里可以看到网站前端和后端的技术等 </h3>
                    </a></li>
                </ul>
            </div>
            <div class="content-block hot-content hidden-xs"
                 th:if="${session.hotArticles eq null || session.hotArticles.size()<=0}">
                <h2 class="title"><strong>本周热门排行</strong></h2>
                <ul>
                    <li class="large"><a href="content.html" target="_blank"
                                         th:href="'/article/show/'+${session.hotArticle1 ne null ? session.hotArticle1.getArticleid() : '-1'}"><img
                            src="/img/main/img3.jpg" alt="ArticleImg"
                            th:src="${session.hotArticle1 ne null ? session.hotArticle1.getArticlecover() : '/img/main/img3.jpg'}">
                        <h3 th:text="${session.hotArticle1 ne null ? session.hotArticle1.getArticletitle() : 'null'}">
                            欢迎来到EasyShare技术博客 </h3>
                    </a></li>
                    <!--此处报错并非存在异常，而在于后台代码编写以及idea解析问题-->
                    <li><a href="content.html" target="_blank"
                           th:href="'/article/show/'+'-1'"><img
                            src="/img/main/logo.jpg" alt="">
                        <h3>null</h3>
                    </a></li>
                    <li><a href="content.html" target="_blank"
                           th:href="'/article/show/'+'-1'"><img
                            src="/img/main/logo.jpg" alt="">
                        <h3>null</h3>
                    </a></li>
                    <li><a href="content.html" target="_blank"
                           th:href="'/article/show/'+'-1'"><img
                            src="/img/main/logo.jpg" alt="">
                        <h3>null</h3>
                    </a></li>
                    <li><a href="content.html" target="_blank"
                           th:href="'/article/show/'+'-1'"><img
                            src="/img/main/logo.jpg" alt="">
                        <h3>null</h3>
                    </a></li>
                </ul>
            </div>
            <div class="content-block new-content">
                <h2 class="title"><strong>最新文章</strong></h2>
                <div class="row">
                    <div class="news-list" th:each="articleLOne1:${articleLOne}">
                        <div class="news-img col-xs-5 col-sm-5 col-md-4"><a target="_blank" href="javascript:;"
                                                                            th:href="'/article/show/'+${articleLOne1.getArticleid()}"><img
                                src="/img/main/logo.jpg" th:src="${articleLOne1.getArticlecover()}" alt="ArticleImg">
                        </a></div>
                        <div class="news-info col-xs-7 col-sm-7 col-md-8">
                            <dl>
                                <dt><a href="javascript:;" th:href="'/article/show/'+${articleLOne1.getArticleid()}"
                                       target="_blank" th:text="${articleLOne1.getArticletitle()}">
                                    EasyShare技术博客正式上线！ </a></dt>
                                <dd><span class="name"><a href="javascript:;"
                                                          th:href="'/page/about?visitor=1&uname='+${articleLOne1.getArticleauthor()}"
                                                          th:text="${articleLOne1.getArticleauthor()}">EasyShare</a></span>
                                    <span
                                            class="identity"></span> <span class="time"
                                                                           th:text="${#dates.format(articleLOne1.getArticlecreatetime(),'yyyy-MM-dd HH:mm:ss')}"> 2015-10-19 </span>
                                </dd>
                                <dd class="text" th:text="'来源：'+${articleLOne1.getArticlesource()}">
                                    xxx
                                </dd>
                                <dd class="text"
                                    th:text="'来源路径：'+${articleLOne1.getArticlesourcehref() eq null||articleLOne1.getArticlesourcehref() eq ''?'无':articleLOne1.getArticlesourcehref()}">
                                    xxx
                                </dd>
                            </dl>
                            <div class="text news_bot col-sm-7 col-md-8"><span class="tags visible-lg visible-md"> <a
                                    href="javascript:;" th:each="tag:${articleLOne1.getArticletaglist()}"
                                    th:text="${tag}">本站</a> </span> <span
                                    class="look"> 共 <strong
                                    th:text="${articleLOne1.getArticleaudiences()}">000</strong> 人围观</span>
                            </div>
                        </div>
                    </div>
                </div>
                <!--<div class="news-more" id="pagination">
                    <a href="">查看更多</a>
                </div>-->
                <input type="hidden" id="currPage" th:value="${currPage}">
                <div class="quotes" style="margin-top:15px"><a href="javascript:;" class="pageNum"
                                                               th:each="i:${#numbers.sequence(1,count)}">[[${i}]]</a>
                </div>
            </div>
        </div>
    </div>
    <!--/内容-->
    <div th:replace="~{commons/rightbar :: rightbar}"></div>
    <!--/右侧>992px显示-->
    <footer th:replace="~{commons/footer :: footer}"></footer>
</section>
<div><a href="javascript:;" class="gotop" style="display:none;"></a></div>
<!--/返回顶部-->
<script src="/js/jquery-3.1.1.min.js" type="text/javascript" th:src="@{/js/jquery-3.1.1.min.js}"></script>
<script src="/js/main/bootstrap.min.js" type="text/javascript" th:src="@{/js/main/bootstrap.min.js}"></script>
<script src="/js/main/nprogress.js" type="text/javascript" th:src="@{/js/main/nprogress.js}"></script>
<script src="/js/main/index-code.js" type="text/javascript" th:src="@{/js/main/index-code.js}"></script>
<script type="text/javascript">
    function getOsInfo() {
        var userAgent = navigator.userAgent.toLowerCase();
        var name = 'Unknown';
        var version = 'Unknown';
        if (userAgent.indexOf('win') > -1) {
            name = 'Windows';
            if (userAgent.indexOf('windows nt 5.0') > -1) {
                version = '2000';
            } else if (userAgent.indexOf('windows nt 5.1') > -1 || userAgent.indexOf('windows nt 5.2') > -1) {
                version = 'XP';
            } else if (userAgent.indexOf('windows nt 6.0') > -1) {
                version = 'Vista';
            } else if (userAgent.indexOf('windows nt 6.1') > -1 || userAgent.indexOf('windows 7') > -1) {
                version = '7';
            } else if (userAgent.indexOf('windows nt 6.2') > -1 || userAgent.indexOf('windows 8') > -1) {
                version = '8';
            } else if (userAgent.indexOf('windows nt 6.3') > -1) {
                version = '8.1';
            } else if (userAgent.indexOf('windows nt 6.2') > -1 || userAgent.indexOf('windows nt 10.0') > -1) {
                version = '10';
            } else {
                version = 'Unknown';
            }
        } else if (userAgent.indexOf('iphone') > -1) {
            name = 'Iphone';
        } else if (userAgent.indexOf('mac') > -1) {
            name = 'Mac';
        } else if (userAgent.indexOf('x11') > -1 || userAgent.indexOf('unix') > -1 || userAgent.indexOf('sunname') > -1 || userAgent.indexOf('bsd') > -1) {
            name = 'Unix';
        } else if (userAgent.indexOf('linux') > -1) {
            if (userAgent.indexOf('android') > -1) {
                name = 'Android';
            } else {
                name = 'Linux';
            }
        } else {
            name = 'Unknown';
        }
        return name;
    }

    const osName = getOsInfo();

    if (osName == "Windows") {
        $("div.item").addClass("windowsMainImg");
    } else if (osName == "Android") {
        $("div.item").addClass("androidMainImg");
    }

    $("div.quotes a").click(function () {
        location.href = "/article/toPage/" + $(this).text();
    });

    var currPage = parseInt($("input#currPage").val()) - 1;
    $("div.quotes").find("a.pageNum:eq(" + currPage + ")").addClass("current");
    //根据当前页面判断是否需要添加标签
    if ($("a.current").index() == 0) {
        $("div.quotes").prepend("<span class='disabled'>首页</span><span class='disabled'>上一页</span>");
        $("div.quotes").append("<a href='javascript:;' class='nextPage'>下一页</a><a href='javascript:;' class='lastPage'>尾页</a>");
    } else if ($("a.current").index() == $("div.quotes a").length - 1) {
        $("div.quotes").prepend("<a href='javascript:;' class='firstPage'>首页</a><a href='javascript:;' class='prevPage'>上一页</a>");
        $("div.quotes").append("<span class='disabled'>下一页</span><span class='disabled'>尾页</span>");
    } else {
        $("div.quotes").prepend("<a href='javascript:;' class='firstPage'>首页</a><a href='javascript:;' class='prevPage'>上一页</a>");
        $("div.quotes").append("<a href='javascript:;' class='nextPage'>下一页</a><a href='javascript:;' class='lastPage'>尾页</a>");
    }
    //js分页跳转操作
    $("a.nextPage").click(function () {
        location.href = "/article/toPage/" + (parseInt($("div.quotes a.current").text()) + 1);
    });

    $("a.lastPage").click(function () {
        location.href = "/article/toPage/" + (parseInt($("div.quotes a.pageNum").length));
    });

    $("a.prevPage").click(function () {
        location.href = "/article/toPage/" + (parseInt($("div.quotes a.current").text()) - 1);
    });

    $("a.firstPage").click(function () {
        location.href = "/";
    });
</script>
</body>
</html>